package fangzhiyi.object;

/**
 * @author fangzhiyi
 * @version 1.0
 * @date 2025/3/18 9:07
 * @description
 */
public class ObjectPractice {
    public static void main(String[] args) {
    Phone phone = new Phone("红米",1980);
        phone.show();
    }


}
class Phone{
    public String brand;
    public double price;

    public void show(){
       String brand = "荣耀";
       double price = 1984.1;
        System.out.println("手机的品牌为："+this.brand+"，手机的价格为:"+this.price);
    }

    public Phone(String brand, double price) {
       this.brand = brand;
       this.price = price;
    }
}